#include <iostream>
#include <typeinfo>
class Base
{
public:
    virtual ~Base() {};
};
class Derived : public Base
{
public:
    Derived() {};
};
int main()
{
    Base *p{new Derived{}};
    dynamic_cast<Derived *>(p); // 若删去虚析构函数，则 dynamic_cast 导致编译错误
    std::cout << (typeid(*p) == typeid(Derived)) << std::endl;
    return 0;
}